hi there,
i would like to know what is the method to look up to CompanyB.customer from Company A.
My coding is as below, but the lookup giving the Customer within the Company A.
Please suggest any method to do the lookup the data to other company book.
Cust.CHANGECOMPANY("OtherCompanyName");
CustCard.SETTABLEVIEW(Cust);
CustCard.SETRECORD(Cust);
CustCard.LOOKUPMODE(TRUE);
IF CustCard.RUNMODAL = ACTION::LookupOK THEN BEGIN
CustCard.GETRECORD(Cust);
message(Cust."No.");
END;
Thank you.
regards,
rachel
0
Comments
Then make sure that the form in not editable.
There are two other ways to do this.
1.
Don't run the form as a variable but with an id.
2.
Do the ChangeCompany also in the OnOpenForm trigger.
You first have to set the companyname with a function in the form.
Object Manager
:thumbsup: Interesting, I never tried it this way, I have always done it the second way you describe changing company directly on the form from a function.
What happens to flow fields drill downs subforms etc when you do it this way? (Yeah I know I could try, but it's easier to just ask )
Object Manager
The temporary table will make sure that you don't start making changes that you don't expect.
I found it is interesting topic & thanks to reijermolenaar that sharing this great trick =D> =D> =D> .
I did some R & D related this.
1. Flow Field's Value is displayed Correct, It get whole record from other company.
2. Look Up : Displayed other company's data correctly, BUT user can insert & edit data of other company which is wrong.
3. Drill Down : Displayed other company's data correctly, BUT user can insert & edit data of other company which is wrong.
4. Go to Card : Displayed the record of current company's data if available,
if not available then also it is display on card with same no. of other company's no. with all field blank.
if we insert something there then system insert that record in current company.
if we not make change then nothing changed.
5. Editable Fields : Dangerous, User can make any changes.
Thanks & Regards,
Purvesh Maisuria.
I didn't know that flowfields were respecting the changecompany.
Learning everyday something new.
Even in the weekend!
Object Manager
Reading the testresults I can only emphasise to please make a different cardform for this and block anything that can cause unexpected behaviour.
Changecompany has been discussed many times weather or not to make it smarter or not.
As far as using the normal Card form that definitely NOT OK, because everything else will show the company that you're logged into. If you really want to have a Card form that looks exactly the same, and acts exactly the same, you will have to create a new form and program the crap out of it.
You have absolutely no idea how much work this is....
After all these years, people still do not take proper precautions when advising others about working with CHAMGECOMPANY.... ](*,)
RIS Plus, LLC