GetWhere (TSDataRemoteObject)

De Wiki1000
(Différences entre les versions)
(Page créée avec « <source lang='delphi'>class function GetWhere(const iWhere,iOrderBy:string; Args:Array of variant):TSDataRemoteObject;</source> Cette fonction retrouve une ressource SData p… »)
 
 
Ligne 49 : Ligne 49 :
  
 
{{Footer|Classe entité de service distant (stereotype)}}
 
{{Footer|Classe entité de service distant (stereotype)}}
 +
[[Category:Stéréotype entité de service distant]]

Version actuelle en date du 15 mars 2013 à 09:09

class function GetWhere(const iWhere,iOrderBy:string; Args:Array of variant):TSDataRemoteObject;

Cette fonction retrouve une ressource SData par une recherche.

Tip-20px.png Tip : Cette méthode utilise un fournisseur de service enregistré dans l'Administration
iWhere La clause Where de recherche.
iOrderBy La clause de tri de recherche.
iArgs Les arguments de la clause Where.

Exemple :

var inst:RE_Expense; aReason:string;
begin
  aReason := Format('expense du %s',[FormatDatetime('c',Now)]);
 
  inst := RE_Expense.Create;
  inst.reason := aReason;
  inst.dateExpense := Now;
  inst.quantity := 1;
  inst.status.AsVariant := RE_NDF_STATUS_DRAFT;
  inst.Post;
 
  showMessage(Format('oid:%s id:%s key:%s etag:%s',[inst.OID,inst.SDataID,inst.SDataKey,inst.SDataEtag]));
 
  inst := RE_Expense.GetWhere('reason=%1','dateExpense',[aReason]) as RE_expense;
  if Assigned(inst) then
   begin
     if inst.reason = aReason
        then showMessage('create ok')
        else showMessage('create failed')
   end
   else showMessage('not found after create');
end;

Voir aussi

Classe entité de service distant (stereotype)Développement DSM





Whos here now:   Members 0   Guests 0   Bots & Crawlers 1
 
Outils personnels