• RainerRichter
  • NEWBIE
  • 30 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 7
    Replies
I'm creating a LWC QuickAction. From a lookup field for accounts I need to fetch the external Id of the Account. I get the account ID from the lookup, but when I pass them to APEX, I get Error 500, Server Error. If I test the same function with the @api recordId it works fine. Here is what I have (relevant parts):
handleCustomerValueSelected(event) is the function in trouble!
 
import { LightningElement, api, wire, track } from 'lwc';
import getAccExternalId from '@salesforce/apex/AI_LessonCreateLwcController.getAccountExternalId';
import { getRecord, getFieldValue } from 'lightning/uiRecordApi';


export default class LessonCreate extends LightningElement {
    @api recordId;
    @api invoke(){};

    @track error;
    @track selectedCustomerRecordId = '';
    @track selectedTeacherRecordId = '';
    selectedCustomerExternalRecordId = '';
    selectedTeacherExternalRecordId = '';
    selectedSubjectRecordId = '';
    accountName;

    handleCustomerValueSelected(event) {
        this.selectedCustomerRecordId = event.detail;
        var custId = event.detail;
        console.log('***CustId: ' + this.selectedCustomerRecordId);
        getAccExternalId({ accId : this.selectedCustomerRecordId })
            .then(response => {
                this.selectedCustomerExternalRecordId = response;
                console.log('***ExId: ' + this.selectedCustomerExternalRecordId);
            })
            .catch(error => {
                this.error = error;
                console.log('***ExId Error: ' + this.error.status);
            });
        
    }


}


And the Apex:

@AuraEnabled
    public static String getAccountExternalId(String accId){
        system.debug('***Apex: ' + accId);
        Account acc = [SELECT Id, ET_UserExternalId__c FROM Account WHERE Id = : accId];
        
        return acc.ET_UserExternalId__c; 
    }


And this is the result from console log:

***CustId: 0011j000018avy1AAA

***ExId Error: 500

As stated before, when I for testing purpos use the "this.recordId" instead "this.this.selectedCustomerRecordId" I get the result. Also if i use a string ID like '0011j000018avy1AAA' works fine.

If somebody has an Idea ...

Hello all,

I have a VF Page with a PageBlock Table and want to add a grouping and a Subtotal. 
Can one direct me into the right direction? Here is the Apex Code:
 
public with sharing class QuoteOLIs {

    public ApexPages.StandardSetController OrderLineItems{
        get{
            if(OrderLineItems == null) {
                OrderLineItems = new
                ApexPages.StandardSetController(Database.getQueryLocator(
                [select ID, Name, booking__c, PriceUnit__c, Sort__c, eTKP__c, Zuschlag__c, 
                 AgencyDiscount__c, No_AE__c, AgencyCommission__c, Position__c, Quantity__c, 
                 Volumediscount__r.name, Volumediscount__c, ready_for_invoicing__c, 
                 SpecialDiscount__c, CustomerDiscount__c, DFP_relevant__c, DFP_gebucht__c, 
                 AD_Country__c, AD_Keywords__c, AD_Weekday__c, AD_Daytime__c, FC_Text__c, 
                 FC_Qty_Views__c, FC_TimeUnit__c,  FC_TimeUnit_Interval__c,Units_guarantee__c, 
                 Placement_Confirmed__c, Garantie__c, Media_gross_MB0__c, expected_Volume__c, 
                 AdItemName__c, Print_Issue__r.Name, Print_Issue__c, Campaign_Start__c, 
                 Campaign_End__c, Distribution__c, Listprice_single_man__c, Calc__c, Ext__c, 
                 override_Agencynet__c, manual_Agencynet__c, Agencynet_MN2__c 
               from CNQ_Order_Line_Item__c
               where booking__c = :ApexPages.currentPage().getParameters().get('id')
               ORDER BY Position__c,Sort__c ASC]));
               OrderLineItems.setPageSize(OrderLineItems.getResultSize());
           }
            return OrderLineItems;
        }
                  private set;
    }
    
    public QuoteOLIs(ApexPages.StandardSetController controller) {
    }
    
    
    public list<CNQ_Order_Line_Item__c> getOLIs()   {
        return (List<CNQ_Order_Line_Item__c>)OrderLineItems.getRecords();
    }
    
     public Pagereference save(){
        OrderLineItems.save();
        CNQ_Order__c quoteorder = [select id from CNQ_Order__c where id = :ApexPages.currentPage().getParameters().get('id')];
        return new apexpages.standardcontroller(quoteorder).view();
    }

}

Thanks for any advice.
Hello together,
I tried to solve this scenario with the process builder, but it seems, one last step has to be done with a trigger!?
I have a Master-Detail relationship between account and a custom object "Account_Branche__c".
When an order line item is created, processbuilder creates a record in another custom object "Revenue_cockpit__c" with some selected data of this order line and it will be enriched with data from the account. 
Now I want to add more data from the "Account_Branche__c" object. To identify the correct record in Account_Branche__c the conditions are: Account__c (Lookup Account) matches the field Agentur__c (lookup account) in Revenue_Cockpit__c.
Field Branche__c in obj Account_Branche__c matches Field Branche__c in Revenue and
Checkbox actice__c is "true".
Then it should copy field SalesMA1__c from object Account_Branche__c to field SalesMA_Agentur__c in object Revenue_cockpit__c.

Can I do that with PB oder must it be a trigger?

If trigger, could somebody help?

Thanks and cheers
Hello,
I'm stuck probably in Syntax Error.
I try to print a QR Code in a VF Page.

This is the formula field content of the field in the custom Object:
IMAGE('https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl=https://XXXXXXX.my.salesforce.com/'&Id,'Scan QR code to open record in mobile.')
This works fine in the record.

I try to output with the following:
<apex:image id="QR" value="https://chart.googleapis.com/chart?chs=100x100&cht=qr&chl=https://XXXXXXX.my.salesforce.com/&ID" width="100" height="100"/>
I tried several syntax variations with " and ' at different positions, but nothing worked.
The XXXXXXX part stands for the domain and "&ID" should be the record ID, from with I call the VF page with a button.
I can enter the domain staticly, but it would be nice, if it could be fetched from the instance.

Thanks for your Help.
Rainer


 
Hello all, 
I'm trying to build a trigger which updates field in a ralted custom object. 
The objects are:
- EDWPM__ITRQ_Positions__c
   -field: EDWPM__EmpID__c

should be inserted in 

- EDWPM__Hardware_CI__c
  -field: EDWPM__ci_employee__c

after Update.

The trigger shows no syntax errors in developer console, but doesn't do anything. Maybe someone has an idea and can help?
Here is my code so far:
Thx! Rainer
trigger HardwareassignProcess on EDWPM__ITRQ_Positions__c (after update) {

	List<EDWPM__ITRQ_Positions__c> posList = new List<EDWPM__ITRQ_Positions__c>();
    
    for(EDWPM__ITRQ_Positions__c pos : posList){

     if(trigger.newMap.get(pos.Id).EDWPM__Hardware_CI_dispatching__c != trigger.oldMap.get(pos.Id).EDWPM__Hardware_CI_dispatching__c){
                
         EDWPM__Hardware_CI__c CI = [SELECT ID from EDWPM__Hardware_CI__c where ID=:pos.EDWPM__Hardware_CI_dispatching__c];
         
         CI.EDWPM__ci_employee__c = pos.EDWPM__EmpID__c ;   
             
         update CI;
     } 
  }
}

 
Hi all,

I'm developing a lttle app on the developer account.
Since yesterday I get an error msg, when I want to open the Package components. It worked fine till last week:

on: https://richter-dev-ed.my.salesforce.com/03358000000Tm68?tab=PackageComponents

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using salesforce.com!

Error ID: 1608713663-5369 (-1569916658)

As I don't have a customer license by now I can't open a case.
Anyone an Idea about this?
The only thing I changed on the weekend is the use of global picklists, which is marked as beta. Can't i use them for packages?

Thanks
Rainer
 
Hello all,

I have a VF Page with a PageBlock Table and want to add a grouping and a Subtotal. 
Can one direct me into the right direction? Here is the Apex Code:
 
public with sharing class QuoteOLIs {

    public ApexPages.StandardSetController OrderLineItems{
        get{
            if(OrderLineItems == null) {
                OrderLineItems = new
                ApexPages.StandardSetController(Database.getQueryLocator(
                [select ID, Name, booking__c, PriceUnit__c, Sort__c, eTKP__c, Zuschlag__c, 
                 AgencyDiscount__c, No_AE__c, AgencyCommission__c, Position__c, Quantity__c, 
                 Volumediscount__r.name, Volumediscount__c, ready_for_invoicing__c, 
                 SpecialDiscount__c, CustomerDiscount__c, DFP_relevant__c, DFP_gebucht__c, 
                 AD_Country__c, AD_Keywords__c, AD_Weekday__c, AD_Daytime__c, FC_Text__c, 
                 FC_Qty_Views__c, FC_TimeUnit__c,  FC_TimeUnit_Interval__c,Units_guarantee__c, 
                 Placement_Confirmed__c, Garantie__c, Media_gross_MB0__c, expected_Volume__c, 
                 AdItemName__c, Print_Issue__r.Name, Print_Issue__c, Campaign_Start__c, 
                 Campaign_End__c, Distribution__c, Listprice_single_man__c, Calc__c, Ext__c, 
                 override_Agencynet__c, manual_Agencynet__c, Agencynet_MN2__c 
               from CNQ_Order_Line_Item__c
               where booking__c = :ApexPages.currentPage().getParameters().get('id')
               ORDER BY Position__c,Sort__c ASC]));
               OrderLineItems.setPageSize(OrderLineItems.getResultSize());
           }
            return OrderLineItems;
        }
                  private set;
    }
    
    public QuoteOLIs(ApexPages.StandardSetController controller) {
    }
    
    
    public list<CNQ_Order_Line_Item__c> getOLIs()   {
        return (List<CNQ_Order_Line_Item__c>)OrderLineItems.getRecords();
    }
    
     public Pagereference save(){
        OrderLineItems.save();
        CNQ_Order__c quoteorder = [select id from CNQ_Order__c where id = :ApexPages.currentPage().getParameters().get('id')];
        return new apexpages.standardcontroller(quoteorder).view();
    }

}

Thanks for any advice.
I do not have any coding experience but hoping someone can help me write the code to Print to PDF from a Custom Object.  We have a Custom Object called "Executive Summary" and I would like to print to PDF when a button is clicked.  I was able to create the button but I can not get it to do anything.  Help Please?  Below is a Screen Shot of my custom object.
User-added image
Hello,
I'm stuck probably in Syntax Error.
I try to print a QR Code in a VF Page.

This is the formula field content of the field in the custom Object:
IMAGE('https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl=https://XXXXXXX.my.salesforce.com/'&Id,'Scan QR code to open record in mobile.')
This works fine in the record.

I try to output with the following:
<apex:image id="QR" value="https://chart.googleapis.com/chart?chs=100x100&cht=qr&chl=https://XXXXXXX.my.salesforce.com/&ID" width="100" height="100"/>
I tried several syntax variations with " and ' at different positions, but nothing worked.
The XXXXXXX part stands for the domain and "&ID" should be the record ID, from with I call the VF page with a button.
I can enter the domain staticly, but it would be nice, if it could be fetched from the instance.

Thanks for your Help.
Rainer


 
Hello all, 
I'm trying to build a trigger which updates field in a ralted custom object. 
The objects are:
- EDWPM__ITRQ_Positions__c
   -field: EDWPM__EmpID__c

should be inserted in 

- EDWPM__Hardware_CI__c
  -field: EDWPM__ci_employee__c

after Update.

The trigger shows no syntax errors in developer console, but doesn't do anything. Maybe someone has an idea and can help?
Here is my code so far:
Thx! Rainer
trigger HardwareassignProcess on EDWPM__ITRQ_Positions__c (after update) {

	List<EDWPM__ITRQ_Positions__c> posList = new List<EDWPM__ITRQ_Positions__c>();
    
    for(EDWPM__ITRQ_Positions__c pos : posList){

     if(trigger.newMap.get(pos.Id).EDWPM__Hardware_CI_dispatching__c != trigger.oldMap.get(pos.Id).EDWPM__Hardware_CI_dispatching__c){
                
         EDWPM__Hardware_CI__c CI = [SELECT ID from EDWPM__Hardware_CI__c where ID=:pos.EDWPM__Hardware_CI_dispatching__c];
         
         CI.EDWPM__ci_employee__c = pos.EDWPM__EmpID__c ;   
             
         update CI;
     } 
  }
}