Trying to display a UD field from Project in a UD field on QuoteHed

Hi everyone,

I’m hoping someone can help me out here. I have a UD field on the Project screen, ‘Specification_c’ and I want to display this on the Quote screen in a UD field ‘Spec_c’. The Project table does not show in the binding options, neither is it available to create a foreign key view. If someone knows how to do this I would be extremely grateful for your help.

Best regards
Adrian

image

Search for posts on BAQ Data views. Those are a good way to grab related data. Most of the examples will talk about adding the results to a grid, but there’s no reason you have to add it to a grid. You can bind the result to a text box. You would need to be able to create a BAQ that given a certian quote number and line can return the project specification.

1 Like

Thanks for the reply @Carson, I have made some small progress. I now have the new dataview Project available for binding but it is of course empty. Is it possible to call the actual Project table as a dataview? or do I have to somehow connect my new Project dataview to the actual Project table to get the Specification_c value?
Thanks again
Adrian

I think you are overthinking this if you are using a dropdown you can use a baq to feed that dropdown if not you can go and do it in code where you create a linq query in code and assign the values to the dropdown or to the text box.

Alex is right if you just want some drop down values you can use a BAQ combo. I’m assuming you have a quote line and you want to look up a value in a related project. The code below would create a BAQ data view that called a BAQ QuoteProjectSpec that had QuoteDtl.QuoteNum and QuoteDtl.QuoteLine. Any other fields in the BAQ would now be available as an Epibinding. Each time a new quote line was selected on the screen the BAQ will run and refresh the binding.

//Using using Ice.Lib.Broadcast; 
//Class Level 
BAQDataView projectSpecBAQDV;



public void CreateProjectSpecBAQDV()
{
	projectSpecBAQDV = new BAQDataView(“QuoteProjectSpec”);
	oTrans.Add(“ProjectSpecBAQDV”,projectSpecBAQDV);
	string pubBinding = "QuoteDtl.QuoteNum";
	IPublisher pub = oTrans.GetPublisher(pubBinding);
	if(pub==null)
	{
		string pubName = Guid.NewGuid().ToString();	//there can be an issue with duplicate pubNames on different screens.
		oTrans.PublishColumnChange(pubBinding, pubName);
		pub = oTrans.GetPublisher(pubBinding);
	}
	if(pub !=null)
		projectSpecBAQDV.SubscribeToPublisher(pub.PublishName, "QuoteDtl_QuoteNum");
	pubBinding = "QuoteDtl.QuoteLine";
	IPublisher pub2 = oTrans.GetPublisher(pubBinding);
	if(pub2==null)
	{
		string pubName = Guid.NewGuid().ToString();
		oTrans.PublishColumnChange(pubBinding, pubName);
		pub2 = oTrans.GetPublisher(pubBinding);
	}
	if(pub2 !=null)
		projectSpecBAQDV.SubscribeToPublisher(pub2.PublishName, "QuoteDtl_QuoteLine");
}
1 Like

Hi @Carson, this is great. Thank you for taking the time to help.
I have a couple of problems though. The code does not run unless I move it into the ‘Initialize Custom Code’ section. Do I have to call it somehow?
I created the BAQ and added the code to publish the Project_Specification_c. It compiles with no errors. How dow do I then bind it to the QuoteHed.Spec_c textbox?
Sorry if the questions are a bit novice like, but this is the first time I have tackled anything like this.
Thanks again for your help.
Best regards
Adrian.

Hi Adrian, this thread might help.

I wanted a ud field from the part table to pull into a quotedtl ud field, so that when you quoted a part, a text box on the quote line would populate with extra info about the part.

A user called Nancy gave me a working answer in the thread, maybe it can help in your case?

Karen

1 Like

Thanks @KMenz I will have a look at this. Like a lot of things in E10, there is more than one way of achieving the same result. I have only ever done basic customisations in the past and I am kind of determined to get this working using customisation and of course Caron’s help. I am also learning a great deal. I may, however, implement your suggestion as a short term solution until I can get the customisation working. Thank you for taking the time to help me.
Best regards
Adrian.

In the earlier customization you will need to add a call to CreateProjectSpecBAQDV(); in the Initialize Custom Code section.
Then you can restart the screen and the ProjectSpecBAQDV should be available like all the other epiDataviews to bind to a textbox.

2 Likes

Thak you @Carson. It works!
I have learned a great deal with your help. Such a relief to get this working. Thanks again.
Best regards
Adrian.