Hi All,
I need to have the No. in the sales invoice details populate based on the sell-to-customer in the header. So when the user selects a sell to customer the No. field auto populates.(it will be auto populating based on a field I added to the customer table.)
I'm having trouble with triggers and how to get this to display once the selection is made.
Any tips or ideas would be greatly appreciated.
Thanks,
Dneal
0
Comments
A friend of me asked the same question last week. I'll ask if he got it to work.
RIS Plus, LLC
Dneal
RIS Plus, LLC
Thanks for all the replies. This is what has happened.
I have the following code put in the OnTimer() trigger of the sales details.
IF Customer.GET(xRec."Sell-to Customer No.") THEN BEGIN
"No." := Customer."Default Account";
CurrForm.UPDATE;
END;
I'm not even sure if this is a good idea to do.
But what is happening now is that the only time the NO. field updates in the sales details is when a No. has been selected in the sales details AND I reselect the Sell-to Customer No.
Why doesn't it show right away?
Dneal
Then the next issue is your use of xRec, why are you using xRec and not Rec?
What do you want to do? When you select a sell-to customer in the Invoice header, you want something on the line to automatically be entered? What do you want to enter automatically? What are the conditions under which this happens? Is this a default value on the Customer Card? There are plenty of field validations in the Sales Header validation that flow through to the line detail that you can take a look at, like Location Code for instance.
RIS Plus, LLC
This is what needs to happen.
To reduce data entry for the customer we have defaulted some of the values in the sales invoice details. The Type is to = G/L Account, the quantity = 1 and the No = the G/L account number on the customer(On the Customer card is a new field that contains a G/L account number.
When a new record is created I have this code on the OnNewRecord of the details subform:
Type := xRec.Type::"G/L Account";
Quantity := 1;
I used xRec because the existing code was using xRec.(I made the assumption I should use it, and just kept using it. :oops: )
When a sales invoice is created and the user selects the Sell-To Customer and they want to see the G/L account number for the customer to appear in the existing No. field of the subform. Here is where I'm running into issues. It would even be acceptable if the user were to click or tab over the type field. But I'm having issues with getting this to display as well.
I really would appreciate some guidance here. I apologize for my lack of understanding of the triggers.
Dneal